Skip to content

Dev#200

Open
DrDakka wants to merge 6 commits intomate-academy:masterfrom
DrDakka:dev
Open

Dev#200
DrDakka wants to merge 6 commits intomate-academy:masterfrom
DrDakka:dev

Conversation

@DrDakka
Copy link
Copy Markdown

@DrDakka DrDakka commented Jan 21, 2026

Tests are failing due to app works a bit different than tests expect

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Great job on the overall structure of your server! The validation logic is solid, and you've correctly implemented streams with the zlib module.

I'm requesting a few changes because the server is currently generating incorrect file extensions for compressed files. The task requires .gz for gzip and .dfl for deflate, but your code produces .gzip and .deflate. This is a core requirement and is causing the tests to fail.

This issue originates in src/constants.js and affects the filename generation in src/createServer.js. You can fix this by creating a map between the compression method name and the correct file extension. For example, gzip should map to gz. Once this is fixed, your solution should be all set!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

bb.on('file', (name, file, { filename }) => {
fileHandled = true;

const finName = `${filename}.${comp}`;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The task description specifies the extensions for compressed files should be .gz for gzip and .dfl for deflate. Currently, you are using the compression method name (comp) directly, which results in .gzip and .deflate. You should create a mapping from the compression method to the correct file extension.

Comment on lines +9 to +10
gzip: 'gzip',
deflate: 'deflate',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the task description, the file extensions for gzip and deflate should be .gz and .dfl, respectively. The current values ('gzip', 'deflate') lead to incorrect extensions (.gzip, .deflate) being generated by the server. To fix this, these values should be changed to the correct extensions, similar to how brotli: 'br' is already handled.

Comment on lines +32 to +34
enctype="multipart/form-data"
>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The display text for these options is currently the same as their value. If you update the values to be the required file extensions (e.g., 'gz'), the user will see these short extensions in the dropdown. For better user experience, consider hardcoding the full names (gzip, deflate, brotli) as the display text while using the shorter extensions for the value attribute.

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Excellent work fixing the file extension issue! The server now correctly generates .gz, .dfl, and .br extensions.

However, a change is needed because there's now a mismatch between the compression types your server expects and what the requirements specify. Your application expects short names like gz, but the requirements and tests use the full names like gzip. This is causing your validation to fail and is the likely reason the tests aren't passing.

To resolve this, please:

  1. Update the <option> values in your HTML form to use the full names: gzip, deflate, and br.
  2. Adjust your validation logic to accept these full names.
  3. Map the full names to the correct file extensions (e.g., gzip maps to .gz) when you construct the filename in createServer.js.

You're very close to finishing this!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Excellent work on this iteration! You've successfully addressed all the feedback from the previous review. The form now correctly uses the gzip, deflate, and br compression types, and the server-side logic handles them perfectly. Your implementation now meets all the task requirements. This is a solid submission, and I am happy to approve it. Well done!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants